package com.calenda.setevent.adapter;

import java.util.ArrayList;

import com.calenda.setevent.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ListViewGroupAdapter extends BaseAdapter{
	private ArrayList<String> arrData;
	private LayoutInflater inflater;
	
	public ListViewGroupAdapter(Context context,ArrayList<String> arrData) {
		inflater = LayoutInflater.from(context);
		this.arrData = arrData;
	}

	@Override
	public int getCount() {
		return arrData.size();
	}

	@Override
	public String getItem(int arg0) {
		return arrData.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		if(arg1 == null){
			arg1 = inflater.inflate(R.layout.listview_item, null);
		}
		TextView tvNameGroup = (TextView)arg1.findViewById(R.id.tvNameGroup);
		tvNameGroup.setText(arrData.get(arg0));
		return arg1;
	}

}
